public class login {
    @PostMapping("login")
    public String login(String username, String password, String usertype) throws Exception {
        req.setCharacterEncoding("utf-8");
        LoginUser loginUser;
        if (usertype.equals("admin")) {
            QueryWrapper<Admin> wrapper = new QueryWrapper<>();
            wrapper.eq("username", username);
            wrapper.eq("password", password);
            loginUser = adminService.getOne(wrapper);
            if (loginUser != null) {
                req.getSession().setAttribute("user", loginUser);
                req.getSession().setAttribute("role", "admin");
                return "hello";
            }
        }
        if (usertype.equals("user")) {
            // 用户登录逻辑
        }
        req.setAttribute("message", "账号密码有误，登录失败");
        return "login";
    }

}
